home *** CD-ROM | disk | FTP | other *** search
/ Delphi 2.0 - Programmer's Utilities Power Pack / Delphi 2.0 Programmer's Utilities Power Pack.iso / m_to_r / rr65 / rrxint.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1996-09-15  |  17.6 KB  |  491 lines

  1. { Function prototypes and declarations for XBASE edition }
  2. { Of R&R V6.5 }
  3.  
  4. { Author Chris Brooksbank (cbrooksbank@msn.com) }
  5. { Written : October 1995 }
  6.  
  7. unit RRxint;
  8.  
  9. interface
  10.  
  11. uses WinTypes;
  12.  
  13.  
  14.  
  15.  
  16. { XBASE Specific Functions }
  17.  
  18.  
  19.  
  20.  
  21.  
  22. { Get/set Scope info XBASE only }
  23. function GetHighScope(hReport:Integer;HiScope:PChar;ScopeSize:Integer):Boolean;far;
  24. function GetLowScope(hReport:Integer;LoScope:PChar;ScopeSize:Integer):Boolean;far;
  25. function SetHighScope(hReport:Integer;HiScope:Pchar):Boolean;far;
  26. function SetLowScope(hReport:Integer;LowScope:Pchar):Boolean;far;
  27. function SetScopeUsage(hReport:Integer;UsageFlag:Char):Boolean;far;
  28. function GetScopeUsage(hReport:Integer;UsageFlag:PChar):Boolean;far;
  29.  
  30. { MasterIndex }
  31. function GetMasterIndexInfo(hReport:Integer;IndexName:PChar;IndexNameSize:Integer;
  32.                             DataType,TagName:PChar;TagSize:Integer):Boolean;far;
  33. function SetMasterIndexInfo(hReport:Integer;IndexName:PChar;DataType:Char;
  34.                             TagName:PChar):Boolean;far;
  35.  
  36. function SetXbaseEditor(hReport:Integer;MemoFlag:Boolean):Boolean;far;
  37.  
  38. { ExtNumber means : 0-none,1-CDX,2-IDX,3-MDX,4-NDX,5-NSX,6-NTX,7-WDX }
  39. function SetIndexExtension(hReport,ExtNumber:Integer):Boolean;far;
  40.  
  41. { Allow writes to tables whilst report running ? }
  42. function SetWriteAllow(hReport:Integer;AllowWrites:Boolean):Boolean;far;
  43.  
  44. { get/set Relations }
  45. function GetFirstRelationInfo(hReport:Integer;tablename:Pchar;sizetablename:Integer;
  46.                              indexname:PChar;sizeindexname:Integer;
  47.                  TagName:PChar;TagNameSize:Integer;
  48.                  AliasName:PChar;AliasName:Integer):Boolean;far;
  49. function GetNextRelationInfo(hReport:Integer;tablename:Pchar;sizetablename:Integer;
  50.                              indexname:PChar;sizeindexname:Integer;
  51.                  TagName:PChar;TagNameSize:Integer;
  52.                  AliasName:PChar;AliasName:Integer):Boolean;far;
  53. function SetRelationInfo(hReport:Integer;tablename,IndexName,TagName,AliasName:Pchar;
  54.              RelationNumber:Integer):Boolean;far;
  55.  
  56.  
  57.  
  58.  
  59. { Generic functions }
  60.  
  61.  
  62.  
  63.  
  64. { ************* Initialisation and cleanup functions/ run report ******* }
  65. function InitRunTimeInstance: Boolean;far;
  66.   { You must call this function first. It initialises an instance of the
  67.     R&R runtime DLL }
  68. function EndRunTimeInstance: Boolean;far;
  69.   { Call this function to cleanup after you have finished using the R&R
  70.     runtime DLL }
  71. function EndReport(hReport: Integer): Boolean;far;
  72.   { Free resources allocated to a report. Always call after using a report. }
  73. function  ChooseReport(MyApp,LibName,RepName:PChar;Size: Integer): Integer;far;
  74.   { Given a report library and report name return a handle to this report.
  75.     Most functions need a hReport param. That is what this function returns.
  76.     If RepName is NIL interactively asks for report from menu }
  77. function  GetNewReportHandle(MyApp: PChar): Integer;far;
  78.   { Another way of getting a report handle. This is a handle to a empty
  79.     report information structure. Use ChooseReport in preference to this }
  80. function  execRuntime(hReport:Integer;Wait:Boolean;cmdShow: Integer;
  81.                       ECode: PInteger;PageCount: PLongInt;
  82.                       EMsg:Pchar;Emsgsizeof: Integer): Boolean;far;
  83.    { After getting a report handle and amending any settings call this
  84.      function to actually run the report
  85.      cmdShow can be sw_hide,sw_minimize,sw_restore,sw_show,sw_showmaximized,
  86.                     sw_showminimized,sw_showminnoactive,sw_showna,
  87.             sw_shownoactive,sw_shownormal
  88.             ie any Windows API ShowWindow
  89.      on Return Ecode value indicates (Error message in EMsg) :
  90.      Ecode=N Successful execution of report
  91.      Ecode=C User cancelled the report Emsg="Report canceled"
  92.      Ecode=J Report structure pointed to by hReport is incorrect/corrupt
  93.      Ecode=R Report began to execute but failed to complete. }
  94. { ********************************************************************** }
  95.  
  96.  
  97. { ********************************************************************** }
  98. { Getting information about R&R errors }
  99. function GetErrorInfo(Msg:PChar;MsgSize:Integer;ErrCode:PInteger): Boolean;far;
  100.   { Get error message and code returned by last DLL call }
  101.   { ErrCode can be :
  102.     C=Cancel. User cancelled a dialog box presented by the R&R DLL
  103.     D=Diagnostic. Misc. error such as out of memory
  104.     I=Iteration. No more values for requested getfirst or getnext function
  105.     J=Job Control. Problem with specified runtime control file
  106.     L=Library.Problem with report library being accessed
  107.     S=Syntax error.
  108.     V=Value. No value available for specified paramater.}
  109. function resetErrorInfo: Boolean;far;
  110.   { Clear out the last error message }
  111. { ********************************************************************** }
  112.  
  113.  
  114. { Which page to start printing at }
  115. function  GetBeginPage(hReport: Integer;BeginPage: Plongint): Boolean;far;
  116. function  SetBeginPage(hReport: Integer;lBeginPage: longint): Boolean;far;
  117.  
  118. { Which page to end printing at }
  119. function  GetEndPage(hReport:Integer;EndPage: Plongint): Boolean;far;
  120. function  SetEndPage(hReport: Integer;EndPage: LongInt): Boolean;far;
  121.  
  122. { How many copies of report to print }
  123. function  GetCopies(hReport: Integer;Copies: PInteger): Boolean;far;
  124. function  SetCopies(hReport: Integer;Copies: Integer): Boolean;far;
  125.  
  126. { Should R&R display errors on the screen ? }
  127. function SetDisplayErrors(hReport:Integer;DispErr: Boolean): Boolean;far;
  128. function GetDisplayErrors(hReport:Integer;DispErr: Pbool): Boolean;far;
  129.  
  130. { Should R&R display a status window as the report is being generated ? }
  131. function SetDisplayStatus(hReport:Integer;DispStatus: Boolean): Boolean;far;
  132. function GetDisplayStatus(hReport:Integer;DispStatus:PBool): Boolean;far;
  133.  
  134. { Export destination }
  135. { D=Display
  136.   F=File
  137.   P=Printer }
  138. function SetExportDest(hReport:Integer;Val: char ): Boolean;far;
  139. function GetExportDest(hReport:Integer;Val: PChar): Boolean;far;
  140.  
  141. { View/alter the filter the report will use }
  142. function setFilter(hReport:Integer;Filter: PChar): Boolean;far;
  143. function getFilter(hReport:Integer;Filter:Pchar;Size:Integer): Boolean;far;
  144.  
  145. { Which filter to use }
  146. { S=use filter saved with report
  147.   E=dont use any filter. Use entire recordset
  148.   O=Use filter specified with setfilter()
  149.   ?=Allow user to interactively design filter at runtime }
  150. function setFilterUsage(hReport:Integer;Val:Char): Boolean;far;
  151. function getFilterUsage(hReport:Integer;Val: PChar): Boolean;far;
  152.  
  153. { get/set the main table to be used in the report }
  154. function setMasterTableName(hReport:Integer;FileName:PChar): Boolean;far;
  155. function getMasterTableName(hReport:Integer;Filename: PChar;Size: Integer): Boolean;far;
  156.  
  157. { get/set the ASCII memo file to use in the report }
  158. function setMemoName(hReport:Integer;Path:Pchar): Boolean;far;
  159. function getMemoName(hReport:Integer;Path:PChar;Size:Integer): Boolean;far;
  160.  
  161. { get/set the Report output destination }
  162. { D=Display
  163.   A/T=Text File - set by setOutputFile
  164.   P=Printer
  165.   W=Worksheet File
  166.   X=XBASE file
  167.   ?=Interactive at runtime }
  168. function setOutputDest(hReport:Integer;Dest:Char): Boolean;far;
  169. function getOutputDest(hReport:Integer;Dest:Pchar): Boolean;far;
  170.  
  171. { Filename to output report to }
  172. function setOutputFile(hReport:Integer;Name:Pchar): Boolean;far;
  173. function getOutputFile(hReport:Integer;Name:PChar;Size: Integer): Boolean;far;
  174.  
  175. { Allow user to interactively select the printer to use }
  176. { can later pass selected name to setPrinter }
  177. function ChoosePrinter(hReport:Integer;Printer:PChar;SizePrinter:Integer;
  178.                    PortName:PChar;SizePort:Integer): Boolean;far;
  179.  
  180. { Get/set printer name associated with the report }
  181. function getPrinter(hReport:Integer;PrinterName: PChar;Size: Integer): Boolean;far;
  182. function setPrinter(hReport:Integer;PrinterName: PChar): Boolean;far;
  183.  
  184. { Set the parent window of the preview window by passing the window handle }
  185. function SetWinParentHandle(hReport:Integer;hParent:Integer): Boolean;far;
  186.  
  187. { Replace the default data directory specified in RSW.INI }
  188. function SetDataDir(hReport:Integer;Dir:PChar): Boolean;far;
  189.  
  190. { Get/set functions for group fields }
  191. function GetFirstGroupField(hReport:Integer;Name:PChar;Size:Integer): Boolean;far;
  192. function GetNextGroupField(hReport:Integer;Name:PChar;Size:Integer):  Boolean;far;
  193. { GetErrorInfo() returns 'I' in 3rd param when no more in list }
  194. function SetGroupField(hReport:Integer;Name:Pchar;GroupNum:Integer): Boolean;far;
  195. { Need to setgroupfields 1..last one to modify }
  196.  
  197. { Replace the default image directory as stored in RSW.INI }
  198. function SetImageDir(hReport:Integer;Dir:PChar): Boolean;far;
  199.  
  200. { Get/Set printer port }
  201. function GetPrinterPort(hReport:Integer;PortName:PChar;Size:Integer): Boolean;far;
  202. function SetPrinterPort(hReport:Integer;Port:PChar): Boolean;far;
  203.  
  204. { R=User prompted to select a report from current report library
  205.   ?=User prompted to pick a succession of reports }
  206. function GetReportPick(hReport:Integer;Pickflag:PChar): Boolean;far;
  207. function SetReportPick(hReport:Integer;Pickflag:Char): Boolean;far;
  208.  
  209. { Functions to get/set sort fields }
  210. function GetFirstSortField(hReport:Integer;Name:PChar;Size:Integer): Boolean;far;
  211. function GetNextSortField(hReport:Integer;Name:PChar;Size:Integer): Boolean;far;
  212. { GetErrorInfo() returns 'I' in 3rd param when no more in list }
  213. function SetSortField(hReport:Integer;Name:PChar;SortNum:Integer): Boolean;far;
  214.  
  215. { Get field names available to report }
  216. function GetFirstFieldName(hReport:Integer;FieldName:PChar;FnSize:Integer): Boolean;far;
  217. function GetNextFieldName(hReport:Integer;FieldName:PChar;Fnsize:Integer): Boolean;far;
  218. { GetErrorInfo() returns 'I' in 3rd param when no more in list }
  219.  
  220. { Get/set user paramaters }
  221. function GetFirstUserParam(hReport:Integer;PName:PChar;PNameSize:Integer;
  222.                        PValue:PChar;PValueSize:Integer): Boolean;far;
  223. function GetNextUserParam(hReport:Integer;PName:PChar;PNameSize:Integer;
  224.                        PValue:PChar;PValueSize:Integer): Boolean;far;
  225. { GetErrorInfo() returns 'I' in 3rd param when no more in list }
  226. function SetUserParam(hReport:Integer;Name:PChar;Value:PChar): Boolean;far;
  227. { To get R&R to ask in a dialog 'Enter Your Name :' then pass a value of
  228.   "?Enter your name:"}
  229.  
  230. { Should user be allowed to abort report when R&R is generating it by
  231.   clicking on a cancel button ? }
  232. function GetPreventEscape(hReport:Integer;Value:PBool): Boolean;far;
  233. function SetPreventEscape(hReport:Integer;Value:Boolean): Boolean;far;
  234.  
  235. { Get/set report library name and directory }
  236. function GetLibrary(hReport:Integer;LibName:PChar;LibNameSize:Integer): Boolean;far;
  237. function setLibrary(hreport:Integer;LibName:PChar): Boolean;far;
  238. function setLibraryDir(hReport:Integer;DirName:PChar): Boolean;far;
  239.  
  240.  
  241. { Should user be offered a test pattern before real report is printed ? }
  242. function getTestPattern(hReport:Integer;Value:PBool): Boolean;far;
  243. function setTestPattern(hReport:Integer;Value:Boolean): Boolean;far;
  244.  
  245. { Read/write all configurations for current report to a ASCII file }
  246. function getRunTimeRecord(AppName:PChar;Filename:PChar): Integer;far;
  247. function writeRunTimeRecord(hReport:Integer;FileName:PChar): Boolean;far;
  248.  
  249. { Should status file be updated after every page or just at report end ? }
  250. { status file only applicable when execRuntime is passed Wait of nonzero}
  251. function getStatusEveryPage(hReport:Integer;Value:PBool):Boolean;far;
  252. function setStatusEveryPage(hReport:Integer;Value:Boolean):Boolean;far;
  253. function setStatusFileName(hReport:Integer;FileName:PChar): Boolean;far;
  254.  
  255. { Suppress title and summary areas for empty reports ? }
  256. function setSuppressTitle(hReport:Integer;Value:Boolean): Boolean;far;
  257.  
  258. { Get/set caption for runtime windows displayed by R&R runtime }
  259. function setWinTitle(hReport:Integer;Title:PChar): Boolean;far;
  260. function getWinTitle(hReport:Integer;Title:Pchar;Size:Integer): Boolean;far;
  261.  
  262. { Style of print-preview window
  263.   0=No Border
  264.   1=Fixed size & single line border
  265.   2=User can change size of preview window
  266.   3=Fixed size and double line border }
  267. function setWinBorderStyle(hReport:Integer;Style:Integer): Boolean;far;
  268.  
  269. { Should preview window have a control menu ? }
  270. function setWinControlBox(hReport:Integer;ControlBox:Boolean): Boolean;far;
  271.  
  272. { Get/set dimensions of report preview window }
  273. function setWinTop(hReport,WinTop:Integer): Boolean;far;
  274. function setWinLeft(hReport,Left:Integer): Boolean;far;
  275. function setWinWidth(hReport,WinWidth:Integer): Boolean;far;
  276. function setWinHeight(hReport,Height:Integer): Boolean;far;
  277.  
  278. { Allow minimize and maximise of preview window ? }
  279. function setWinMaxButton(hReport:Integer;AllowButton:Boolean): Boolean;far;
  280. function setWinMinButton(hReport:Integer;AllowButton:Boolean): Boolean;far;
  281.  
  282. { New to R&R V6.5 GetFilteredField Names }
  283. { Fieldnames available for the report suitable for use in sort/groups }
  284. { filterid code : 1 sortfield, 2 groupfield } 
  285. function GetFirstFilteredFieldName(hReport:Integer;FieldName:PChar;
  286.                           FieldNameSize:Integer;filterID:Integer):Boolean;far;
  287. function GetNextFilteredFieldName(hReport:Integer;FieldName:PChar;
  288.                           FieldNameSize:Integer;filterID:Integer):Boolean;far;
  289.  
  290.  
  291. implementation
  292.  
  293. { Tell Delphi that all the functions are stored in RREPORT.DLL }
  294.  
  295.  
  296. { XBASE Specific Functions }
  297.  
  298. function GetHighScope;
  299.   external 'RREPORT';
  300. function SetHighScope;
  301.   external 'RREPORT';
  302. function GetLowScope;
  303.   external 'RREPORT';
  304. function SetLowScope;
  305.   external 'RREPORT';
  306. function SetScopeUsage;
  307.   external 'RREPORT';
  308. function GetScopeUsage;
  309.   external 'RREPORT';
  310. function GetMasterIndexInfo;
  311.   external 'RREPORT';
  312. function SetMasterIndexInfo;
  313.   external 'RREPORT';
  314. function SetWriteAllow;
  315.   external 'RREPORT';
  316. function SetXbaseEditor;
  317.   external 'RREPORT';
  318. function SetIndexExtension;
  319.   external 'RREPORT';
  320. function GetFirstRelationInfo;
  321.   external 'RREPORT';
  322. function GetNextRelationInfo;
  323.   external 'RREPORT';
  324. function SetRelationInfo;
  325.   external 'RREPORT';
  326.  
  327.  
  328. { Generic Functions }
  329.  
  330.  
  331. function initRunTimeInstance;
  332.   external 'RREPORT';
  333. function endRunTimeInstance;
  334.   external 'RREPORT';
  335. function endReport;
  336.   external 'RREPORT';
  337. function chooseReport;
  338.   external 'RREPORT';
  339. function GetNewReportHandle;
  340.   external 'RREPORT';
  341. function execRunTime;
  342.   external 'RREPORT';
  343. function GetErrorInfo;
  344.   external 'RREPORT';
  345. function ResetErrorInfo;
  346.   external 'RREPORT';
  347. function GetBeginPage;
  348.   external 'RREPORT';
  349. function SetBeginPage;
  350.   external 'RREPORT';
  351. function GetEndPage;
  352.   external 'RREPORT';
  353. function SetEndPage;
  354.   external 'RREPORT';
  355. function GetCopies;
  356.   external 'RREPORT';
  357. function SetCopies;
  358.   external 'RREPORT';
  359. function SetDisplayErrors;
  360.   external 'RREPORT';
  361. function GetDisplayErrors;
  362.   external 'RREPORT';
  363. function SetDisplayStatus;
  364.   external 'RREPORT';
  365. function GetDisplayStatus;
  366.   external 'RREPORT';
  367. function SetExportDest;
  368.   external 'RREPORT';
  369. function GetExportDest;
  370.   external 'RREPORT';
  371. function setFilter;
  372.   external 'RREPORT';
  373. function getFilter;
  374.   external 'RREPORT';
  375. function setFilterUsage;
  376.   external 'RREPORT';
  377. function getFilterUsage;
  378.   external 'RREPORT';
  379. function setMasterTableName;
  380.   external 'RREPORT';
  381. function getMasterTableName;
  382.   external 'RREPORT';
  383. function setMemoName;
  384.   external 'RREPORT';
  385. function getMemoName;
  386.   external 'RREPORT';
  387. function setOutputDest;
  388.   external 'RREPORT';
  389. function getOutputDest;
  390.   external 'RREPORT';
  391. function setOutputFile;
  392.   external 'RREPORT';
  393. function getOutputFile;
  394.   external 'RREPORT';
  395. function ChoosePrinter;
  396.   external 'RREPORT';
  397. function getPrinter;
  398.   external 'RREPORT';
  399. function setPrinter;
  400.   external 'RREPORT';
  401. function SetWinParentHandle;
  402.   external 'RREPORT';
  403. function SetDataDir;
  404.   external 'RREPORT';
  405. function getFirstGroupField;
  406.   external 'RREPORT';
  407. function getNextGroupField;
  408.   external 'RREPORT';
  409. function SetGroupField;
  410.   external 'RREPORT';
  411. function SetImageDir;
  412.   external 'RREPORT';
  413. function GetPrinterPort;
  414.   external 'RREPORT';
  415. function SetPrinterPort;
  416.   external 'RREPORT';
  417. function GetReportPick;
  418.   external 'RREPORT';
  419. function SetReportPick;
  420.   external 'RREPORT';
  421. function GetFirstSortField;
  422.   external 'RREPORT';
  423. function GetNextSortField;
  424.   external 'RREPORT';
  425. function SetSortField;
  426.   external 'RREPORT';
  427. function GetFirstFieldName;
  428.   external 'RREPORT';
  429. function GetNextFieldName;
  430.   external 'RREPORT';     
  431. function GetFirstUserParam;
  432.   external 'RREPORT';
  433. function GetNextUserParam;
  434.   external 'RREPORT';
  435. function SetUserParam;
  436.   external 'RREPORT';
  437. function GetPreventEscape;
  438.   external 'RREPORT';
  439. function SetPreventEscape;
  440.   external 'RREPORT';
  441. function GetLibrary;
  442.   external 'RREPORT';
  443. function setLibrary;
  444.   external 'RREPORT';
  445. function setLibraryDir;
  446.   external 'RREPORT';
  447. function getTestPattern;
  448.   external 'RREPORT';
  449. function setTestPattern;
  450.   external 'RREPORT';
  451. function getRunTimeRecord;
  452.   external 'RREPORT';
  453. function writeRunTimeRecord;
  454.   external 'RREPORT';
  455. function getStatusEveryPage;
  456.   external 'RREPORT';
  457. function setStatusEveryPage;
  458.   external 'RREPORT';
  459. function setStatusFileName;
  460.   external 'RREPORT';
  461. function setSuppressTitle;
  462.   external 'RREPORT';
  463. function setWinTitle;
  464.   external 'RREPORT';
  465. function getWinTitle;
  466.   external 'RREPORT';
  467. function setWinBorderStyle;
  468.   external 'RREPORT';
  469. function setWinControlBox;
  470.   external 'RREPORT';
  471. function setWinTop;
  472.   external 'RREPORT';
  473. function setWinLeft;
  474.   external 'RREPORT';
  475. function setWinWidth;
  476.   external 'RREPORT';
  477. function setWinHeight;
  478.   external 'RREPORT';
  479. function setWinMaxButton;
  480.   external 'RREPORT';
  481. function setWinMinButton;
  482.   external 'RREPORT';
  483. function GetFirstFilteredFieldName;
  484.   external 'RREPORT';
  485. function GetNextFilteredFieldName;
  486.   external 'RREPORT';
  487.  
  488.  
  489. end.
  490.  
  491.